﻿/**
 *    Copyright 2006 - 2011 Opera Software ASA
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 *
 **/


// Autogenerated by hob
window.cls || (window.cls = {});
cls.Scope || (cls.Scope = {});
cls.Scope["1.0"] || (cls.Scope["1.0"] = {});

cls.Scope["1.0"].HostInfo = function(arr)
{
  this.stpVersion = arr[0];
  this.coreVersion = arr[1];
  this.platform = arr[2];
  this.operatingSystem = arr[3];
  this.userAgent = arr[4];
  this.serviceList = (arr[5] || []).map(function(item)
  {
    return new cls.Scope["1.0"].Service(item);
  });
  this.toString = function() { return "[message HostInfo]"; }
};

cls.Scope["1.0"].Service = function(arr)
{
  this.name = arr[0];
  /** 
    * This field contains the major and minor version number of the service.
    * The first number is the major version, the second is the minor, and any additional
    * numbers/strings are not of relevance but can be shown to the end-user if wanted.
    * 
    * The major version determines major changes (ie. compatibility breaks), while
    * the minor version determines incremental changes (ie. backwards compatible).
    * The client must check these two numbers to ensure it is able to communicate
    * properly with the service. If the major version is different from the
    * versions the client is compatible with, or the minor version is less than
    * the required version, it must disconnect.
    * 
    * Let us say a client supports version 1.6 and up and also version 2.0 and up.
    * It would do::
    * 
    *   if major == 1 and minor >= 6 or major == 2:
    *     print "We support service version %d.%d" % (major, minor)
    *   else:
    *     print "We do not support service version %d.%d" % (major, minor)
    */
  this.version = arr[1];
  this.toString = function() { return "[message Service]"; }
};

